
import unittest

from SmallShop.BaseObject.BaseObject import BaseObject

from selenium.webdriver.common.by import By

from time import sleep

from ddt import ddt,file_data

from selenium import webdriver

# @ddt
class PageObject(BaseObject):

    url = "http://www.litemall360.com:8081/#/login"

    SendUser = (By.CSS_SELECTOR,"#app > div > form > div:nth-child(2) > div > div > input")

    SendPwd = (By.CSS_SELECTOR,"#app > div > form > div:nth-child(3) > div > div > input")

    ClickLogin = (By.CSS_SELECTOR,"#app > div > form > button")

    # @file_data("../data/login.yaml")
    def test_UserLogin(self,uname,pwd):

        self.BaseUrl(self.url)

        sleep(2)

        self.ClearData(self.SendUser)

        sleep(2)

        self.SendValue(self.SendUser,uname)

        sleep(2)

        self.ClearData(self.SendPwd)

        sleep(2)

        self.SendValue(self.SendPwd,pwd)

        sleep(2)

        self.ClickData(self.ClickLogin)

        sleep(3)


if __name__ == '__main__':

    drive = webdriver.Chrome()

    ar = PageObject(drive)

    ar.test_UserLogin("admin123","admin123")


